package com.liwie.app;

public class MyApp7 {
    Runnable r1=()->{
        while (true){
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+":"+"ok");
        }
    };
    Runnable r2=()->{
        while (true){
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+":"+"ok");
        }
    };

    public static void main(String[] args) {
        MyApp7 myApp7 = new MyApp7();
        Thread thread1=new Thread(myApp7.r1,"r1");
        Thread thread2=new Thread(myApp7.r2,"r2");
        thread1.start();
        thread2.start();
    }
}
